package fr.afcepf.ai89.esharing.entity;

import java.io.Serializable;
import javax.persistence.*;

/**
 * The primary key class for the fr_code_postal_asso database table.
 * 
 */
@Embeddable
public class FrCodePostalAssoPK implements Serializable {
	//default serial version id, required for serializable classes.
	private static final long serialVersionUID = 1L;

	@Column(name="CODE_POSTAL")
	private long codePostal;

	@Column(name="ID_DEPT_COM")
	private String idDeptCom;

	@Column(name="CODE_COMMUNE")
	private long codeCommune;

	public FrCodePostalAssoPK() {
	}
	public long getCodePostal() {
		return this.codePostal;
	}
	public void setCodePostal(long codePostal) {
		this.codePostal = codePostal;
	}
	public String getIdDeptCom() {
		return this.idDeptCom;
	}
	public void setIdDeptCom(String idDeptCom) {
		this.idDeptCom = idDeptCom;
	}
	public long getCodeCommune() {
		return this.codeCommune;
	}
	public void setCodeCommune(long codeCommune) {
		this.codeCommune = codeCommune;
	}

	public boolean equals(Object other) {
		if (this == other) {
			return true;
		}
		if (!(other instanceof FrCodePostalAssoPK)) {
			return false;
		}
		FrCodePostalAssoPK castOther = (FrCodePostalAssoPK)other;
		return 
			(this.codePostal == castOther.codePostal)
			&& this.idDeptCom.equals(castOther.idDeptCom)
			&& (this.codeCommune == castOther.codeCommune);
	}

	public int hashCode() {
		final int prime = 31;
		int hash = 17;
		hash = hash * prime + ((int) (this.codePostal ^ (this.codePostal >>> 32)));
		hash = hash * prime + this.idDeptCom.hashCode();
		hash = hash * prime + ((int) (this.codeCommune ^ (this.codeCommune >>> 32)));
		
		return hash;
	}
}